<template>
    <el-form-item label="竞价策略" :prop="`adgroup.delivery.${dataForm.delivery_index}.bid_type`" :rules="{required: true, message: '请选择', trigger: ['blur', 'change']}">
        <el-radio-group v-model="dataForm.adgroup.delivery[dataForm.delivery_index].bid_type" size="small" class="tk_radio_group" @change="changeBid">
            <el-radio label="BID_TYPE_NO_BID" border v-if="dataForm.adgroup.delivery[dataForm.delivery_index].optimization_goal=='VALUE'">
                <div class="radio_text1">最高成交总额 (GMV)</div>
                <div class="radio_text2">充分消耗预算，获得最多的付费价值</div>
            </el-radio>
            <el-radio label="BID_TYPE_NO_BID" border v-else>
                <div class="radio_text1">最低成本</div>
                <div class="radio_text2">获取最多的成效数</div>
            </el-radio>
            <el-radio label="BID_TYPE_CUSTOM" border v-if="dataForm.adgroup.delivery[dataForm.delivery_index].optimization_goal!=='VALUE'">
                <div class="radio_text1">成本上限</div>
                <div class="radio_text2">平均成本稳定在出价附近或低于您的出价</div>
            </el-radio>
        </el-radio-group>
    </el-form-item>
</template>

<script>
export default {
    props: ["dataForm"],
    components: {},
    name: "",
    data() {
        return {
            
        };
    },
    created() {},
    methods: {
        changeBid(val){
            this.dataForm.adgroup.delivery[this.dataForm.delivery_index].bid_price = ""
            this.dataForm.adgroup.delivery[this.dataForm.delivery_index].conversion_bid_price = ""
            if(val=='BID_TYPE_NO_BID'){
                this.dataForm.adgroup.delivery[this.dataForm.delivery_index].pacing = "PACING_MODE_SMOOTH"
            }
            this.sessionSave()
        },

        sessionSave(){
            this.$emit("sessionSave")
        }
    },
};
</script>


<style scoped>
/deep/ .tk_radio_group .el-radio{
    margin-right: 0;
    padding: 12px;
    height: auto;
    width: 250px;
    white-space: normal;
}
/deep/ .tk_radio_group .el-radio .el-radio__input{
    display: none;
}
/deep/ .tk_radio_group .el-radio .el-radio__label{
    padding-left: 0;
}
.radio_text1{
    line-height: 20px;
    font-size: 14px;
}
.radio_text2{
    font-size: 12px;
    color: #B4B7BD;
    line-height: 20px;
    margin-top: 4px;
}
</style>

